<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="__STATIC__/logo.ico" type="image/x-icon" rel="shortcut icon" />
    <title>__ADMIN_TITLE__</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="__STATIC__/plugins/bootstrap/css/bootstrap.min.css">
    <script src="__STATIC__/plugins/jquery/jquery.min.js"></script>
</head>
<body>
<iframe style="display: none" name="ifr" id="ifr"></iframe>
    <div class="container-fluid" id="pannel" style="opacity:0.5;background: url('__STATIC__/admin/img/index.jpg') no-repeat center">
        <div class="panel panel-default " style="width: 30%;float: right;margin-right: 5%;margin-top: 5%">
            <div class="panel-body">
                <form id="test" target="ifr" action="{:url('admin/index/login')}" method="post">
                    <div class="form-group">
                        <label for="admin_name">帐号</label>
                        <input type="text" class="form-control" id="admin_name" name="admin_name" placeholder="请输入管理员帐号">
                    </div>
                    <div class="form-group">
                        <label for="pwd">密码</label>
                        <input type="password" class="form-control" id="pwd" name="pwd" placeholder="请输入密码">
                    </div>
                    <input type="hidden" name="_ajax" value="1">
                    <button type="submit" class="btn btn-default" style="width: 100%">登录</button>
                </form>
            </div>
        </div>
    </div>
    <script src="__STATIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="__STATIC__/common/js/common.js"></script>
    <script src="__STATIC__/admin/js/admin.js"></script>
<script>
    $(function () {
        var frame = $(document).find('#ifr')[0];
        frame.addEventListener('load',function (e) {
            console.log(222222);
            var data = JSON.parse(frame.contentWindow.document.body.textContent);
            if(data.code == 1){
                successMsg(data.msg);
                if(data.url){
                    $.post(data.url,{},function (page) {
                        setTimeout(function () {
                            window.location.href = data.url;

                        },1000);
                    });
                }
            }else{
                errorMsg(d.msg);
            }
        });
        $('#pannel').css({'height':$(window.screen).attr('height')});
    });
</script>
</body>
</html>